package com.mediacloud.app.newsmodule.activity.microlive;

import android.os.Bundle;

import com.mediacloud.app.model.activity.BaseBackActivity;
import com.mediacloud.app.model.activity.SwipeBackFragmentActivity;
import com.mediacloud.app.newsmodule.activity.StyleSetActivity;

/**
 * Created by x on 2018/1/22.
 */

public abstract class BasePresenterActivity<P extends BasePresenter> extends StyleSetActivity
{
    protected P presenter;

    abstract P createPresenter();

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        presenter=createPresenter();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(presenter!=null)
            presenter.destory();
        presenter=null;
    }
}